<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    table{
        border: 1px solid red;
    }
</style>
<body>


<input type="text" placeholder="名字" id="name">
<input type="text" placeholder="工资" id="mony">
<input type="text" placeholder="名字" id="gongzi">
<input type="button" value="添加" onclick="fun()"><br>
<table>
    <tr>
        <td>姓名</td>
        <td>工资</td>
        <td>工作</td>
    </tr>
</table>
<script>
    let name = document.querySelector("#name");
    let mony = document.querySelector("#mony");
    let gongzi = document.querySelector("#gongzi");
    let table = document.querySelector("table");
    function fun(){
        let tr = document.querySelector("tr");
        let names = document.querySelector("td");
        let monys = document.querySelector("td");
        let gongzis = document.querySelector("td");
        //把用户输入的内容添加到td
        names.innerText = name.value;
        monys.innerText = mony.value;
        gongzis.innerText = gongzi.value;
        tr.append(names,monys,gongzis);
        table.append(tr);
    }
</script>

</body>
</html>